/*
** do_p.c for  in /home/deubel_j//colle
** 
** Made by james deubelbeiss
** Login   <deubel_j@epitech.net>
** 
** Started on  Mon Apr 18 21:48:20 2011 james deubelbeiss
** Last update Mon Apr 18 22:34:21 2011 james deubelbeiss
*/

#include <stdlib.h>
#include "my_mastermind.h"

char	*my_strcpy(char *dest, char *src)
{
  int	i;

  i = 0;
  while (src[i] != '\0')
    {
      dest[i] = src[i];
      i = i + 1;
    }
  dest[i] = '\0';
  return (dest);
}

char	*my_strdup(char *s)
{
  char	*s2;

  s2 = xmalloc(sizeof(char) * (my_strlen(s) + 1));
  my_strcpy(s2, s);
  return (s2);
}

t_args	*do_p(t_args *ar, char **av, int i)
{
  int	pionslen;
  int	j;

  j = 0;
  if (av[i + 1] == NULL || av[i + 1][0] == '\0')
    return (ar);
  ar->pions = my_strdup(av[i + 1]);
  return (ar);
}
